﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<!--此页面实现Word图片自动批量上传的功能-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>WordPaster For CKEditor3.x,ExtJS</title>
    <link type="text/css" rel="stylesheet" href="extjs/resources/css/ext-all.css"/>
    <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="extjs/ext-all.js"></script>
    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="WordPaster/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/jquery.min.js"></script>
    <script type="text/javascript" src="WordPaster/w.js" charset="utf-8"></script>
</head>
<body>
	<div style=" font-size:medium; line-height:130%;">
	<p>演示方法：</p>
	<ul style="list-style-type:decimal;">
		<li>打开Word文档，复制多张图片，在编辑器中按下 Ctrl + V 键，编辑器将自动上传所有图片。</li>
		<li>复制电脑中任意图片文件，然后点击编辑器中的粘贴图片按钮<img src="WordPaster/paster.png" width="16px" height="16px"/>。</li>
		<li>通过QQ或其它软件截屏，复制图片，然后点击编辑器中的图片粘贴按钮<img src="WordPaster/paster.png" width="16px" height="16px"/>。</li>
	</ul>
	<p>相关问题：</p>
	<ul style="list-style-type:decimal;">
		<li>WindowsXP如果无法识别数字证书，请先下载运行<a target="_blank" href="http://www.ncmem.com/download/rootsupd.rar">Windows证书补丁</a></li>
		<li>Windows7/Windows2003如果无法识别数字证书，请先下安装<a target="_blank" href="http://www.ncmem.com/download/startcom.cer">数字签名根证书</a></li>
		<li>如果无法安装组件请下载进行安装<a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf%20">Microsoft Visual C++ 2008 Redistributable Package (x86)</a></li>
		<li>如果有任何问题或建议请向我们<a target="_blank" href="http://www.ncmem.com/blog/guestbook.asp">反馈</a></li>
	</ul>
	</div>    
	<!--创建FCKEditor控件-->
	<textarea id="editor1" name="editor1"></textarea>
    <script type="text/jscript" language="javascript">
    	//fix:IE9错误,对象不支持“createContextualFragment”属性或方法。
    	if ((typeof Range !== "undefined") && !Range.prototype.createContextualFragment)
    	{
    		Range.prototype.createContextualFragment = function (html)
    		{
    			var frag = document.createDocumentFragment(),
				div = document.createElement("div");
    			frag.appendChild(div);
    			div.outerHTML = html;
    			return frag;
    		};
    	}

        var pos = window.location.href.lastIndexOf("/");
        var api = [
            window.location.href.substr(0, pos + 1),
            "asp.net/upload.aspx"
        ].join("");
        WordPaster.getInstance({
            //上传接口：http://www.ncmem.com/doc/view.aspx?id=d88b60a2b0204af1ba62fa66288203ed
            PostUrl: api,
            //为图片地址增加域名：http://www.ncmem.com/doc/view.aspx?id=704cd302ebd346b486adf39cf4553936
            ImageUrl: "",
            //设置文件字段名称：http://www.ncmem.com/doc/view.aspx?id=c3ad06c2ae31454cb418ceb2b8da7c45
            FileFieldName: "file",
            //提取图片地址：http://www.ncmem.com/doc/view.aspx?id=07e3f323d22d4571ad213441ab8530d1
            ImageMatch: ''            
        });//加载控件

    	CKEDITOR.on('instanceReady', function (evt)
    	{
            WordPaster.getInstance().SetEditor(evt.editor);
    	});

    	//加载CKEditor编辑器
    	CKEDITOR.replace('editor1');
	</script>
</body>
</html>